<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade"
    tabindex="-1" role="dialog" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #MetaphysicsTypeForm="ngForm" novalidate autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{l("historyVersion")}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <i aria-hidden="true" class="ki ki-close"></i>
                      </button>
                </div>
                <div class="modal-body">

                    <div class="kt-content">
                        <div class="kt-portlet kt-portlet--mobile">
                            <div class="kt-portlet__body">

                                <div class="row">
                                    <div class="col-6" style="padding-left:0;">
                                        <div class="form-group">
                                            <label>{{l("Name")}}</label>
                                            <input class="form-control" type="text" name="Name" [(ngModel)]="item.name"
                                                maxlength="32" readonly>
                                        </div>
                                    </div>
                                    <div class="col-6" style="padding-right:0;">
                                        <div class="form-group">
                                            <label>{{l("versionNumber")}}</label>
                                            <input class="form-control" type="text" name="latestVersion" [(ngModel)]="item.latestVersion"
                                                maxlength="32" readonly>
                                        </div>
                                    </div>
                                </div>
                                <div class="row" style="margin-bottom:15px;position: relative;">
                                    <div class="col-xs-6" style="opacity:0;">
                                        <button class="btn btn-primary blue">
                                            <i class="fa fa-plus"></i> {{l("Create")}}</button>
                                    </div>
                                    <div class="col-xs-6 text-right" style="position:absolute;right:10px;">
                                        <button (click)="Create()" class="btn btn-primary blue">
                                            <i class="fa fa-plus"></i> {{l("Create")}}</button>
                                    </div>
                                </div>

                                <div class="row align-items-center">
                                    <!--<Primeng-Datatable-Start>-->
                                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper0.isLoading">
                                        <p-table #dataTable (onLazyLoad)="getHistory($event)" [value]="primengTableHelper0.records"
                                            [rows]="primengTableHelper0.defaultRecordsCountPerPage" [paginator]="false"
                                            [lazy]="false" [resizableColumns]="primengTableHelper0.resizableColumns"
                                            [responsive]="primengTableHelper0.isResponsive">
                                            <ng-template pTemplate="header">
                                                <tr>
                                                    <th style="width:15%">{{l('Actions')}}</th>
                                                    <th style="width:5%">{{l('RecordId')}}</th>
                                                    <th style="width:15%">{{l('CreationTime')}}</th>
                                                    <th style="width:15%">{{l('versionNumber')}}</th>
                                                    <th>{{l('Download')}}{{l('address')}}</th>
                                                </tr>
                                            </ng-template>
                                            <ng-template pTemplate="body" let-record let-i="rowIndex">
                                                <tr [pSelectableRow]="record" [attr.trid]="record.id">
                                                    <td>
                                                        <div class="btn-group dropdown" dropdown normalizePosition>
                                                            <button class="dropdown-toggle btn btn-sm btn-primary"
                                                                data-toggle="dropdown" dropdownToggle aria-haspopup="true"
                                                                aria-expanded="false">
                                                                <i class="fa fa-cog"></i>
                                                                <span class="caret"></span> {{l("Actions")}}
                                                            </button>
                                                            <ul class="dropdown-menu" *dropdownMenu>
                                                                <li>
                                                                    <a class="icon-bianji dropdown-item" (click)="Edit(record)">{{l('Edit')}}</a>
                                                                </li>
                                                                <!-- <li>
                                                                    <a class="icon-icon-test" (click)="Delete(record)">{{l('Delete')}}</a>
                                                                </li> -->
                                                            </ul>
                                                        </div>
                                                    </td>
                                                    <td style="width:5%"> {{transIndex(i)}}</td>
                                                    <td>
                                                        <span>{{record.creationTime | date:"yyyy/MM/dd"}}</span>
                                                    </td>
                                                    <td>
                                                        <span>{{record.version}}</span>
                                                    </td>
                                                    <td>
                                                        <span>{{record.downloadUrl}}</span>
                                                    </td>
                                                </tr>
                                            </ng-template>
                                            <ng-template pTemplate="emptymessage" let-records>
                                                <tr *ngIf="primengTableHelper0.records">
                                                    <td colspan="7" class="text-center">
                                                        <img class="emptymessage" src="/assets/common/images/placeholder/deviceHolder.png" />
                                                    </td>
                                                </tr>
                                            </ng-template>
                                        </p-table>
                                        <div class="primeng-paging-container">
                                            <p-paginator [rows]="primengTableHelper0.defaultRecordsCountPerPage"
                                                #paginator (onPageChange)="getHistory($event)" [totalRecords]="primengTableHelper0.totalRecordsCount"
                                                [rowsPerPageOptions]="primengTableHelper0.predefinedRecordsCountPerPage">
                                            </p-paginator>
                                            <span class="total-records-count">
                                                {{l('TotalRecordsCount', primengTableHelper0.totalRecordsCount)}}
                                            </span>
                                        </div>
                                    </div>
                                    <!--<Primeng-Datatable-End>-->
                                </div>
                            </div>
                        </div>
                    </div>




                </div>

            </form>
        </div>
    </div>
</div>

<createOrEditApppodModal #createOrEditApppodModal (modalSave)="getHistory()"></createOrEditApppodModal>